﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;


namespace SchoolManagerMVC.BusinessAbstract.Interfaces
{
    public interface IRepository
    {
        List<EntityT> GetAll<EntityT>() where EntityT : class;
        List<EntityT> GetWhere<EntityT>(Func<EntityT, bool> predicate) where EntityT : class;
        object GetSingle<EntityT>(Func<EntityT, bool> predicate) where EntityT : class;

        IMessages Add<EntityT>(EntityT entity) where EntityT : class;

        IMessages Remove<EntityT>(EntityT entity) where EntityT : class;
        void RemoveWhere(Func<string, bool> predicate);
        void RemoveSingle<EntityT>(Func<EntityT, bool> predicate) where EntityT : class;

        void Update<EntityT>(EntityT entity) where EntityT : class;
        void UpdateWhere(Func<string, bool> predicate);
        void UpdateAt(int index);
    }
}
